package com.yunti.yntk.util;

import android.view.TextureView;

public class CircleUtils {
    public static int[] computeCenter(int[] points, TextureView mDrawDetectFaceView) {
        int[] result = new int[3];
        int a = (points[2] * mDrawDetectFaceView.getWidth() / 480 - points[0] * mDrawDetectFaceView.getWidth() / 480) / 2;
        int b = (points[7] * mDrawDetectFaceView.getWidth() / 480 - points[1] * mDrawDetectFaceView.getHeight() / 640) / 2;
        result[0] = a + points[0] * mDrawDetectFaceView.getWidth() / 480;
        result[1] = b + points[1] * mDrawDetectFaceView.getHeight() / 640;
        result[2] = Math.max(a, b);
        return result;
    }
}
